package com.jie.javapoiexcel.test;

import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;

/**
 * @author jie
 * @date 2020/7/1 -10:52
 */
public class test {


    public static void main(String[] args) {
        ExcelTemplate et = ExcelTemplate.getInstance()
                .readTemplateByClasspath("C:\\Users\\CurvedMirror\\Desktop\\javapoiexcel\\src\\main\\resources\\excel\\default.xls");
        et.createNewRow();
        et.createCell("1111111");
        et.createCell("aaaaaaaaaaaa");
        et.createCell("a1");
        et.createCell("a2a2");
        et.createNewRow();
        et.createCell("222222");
        et.createCell("bbbbb");
        et.createCell("b");
        et.createCell("dbbb");
        et.createNewRow();
        et.createCell("3333333");
        et.createCell("cccccc");
        et.createCell("a1");
        et.createCell(12333);
        et.createNewRow();
        et.createCell("4444444");
        et.createCell("ddddd");
        et.createCell("a1");
        et.createCell("a2a2");
        et.createNewRow();
        et.createCell("555555");
        et.createCell("eeeeee");
        et.createCell("a1");
        et.createCell(112);
        et.createNewRow();
        et.createCell("555555");
        et.createCell("eeeeee");
        et.createCell("a1");
        et.createCell("a2a2");
        et.createNewRow();
        et.createCell("555555");
        et.createCell("eeeeee");
        et.createCell("a1");
        et.createCell("a2a2");
        et.createNewRow();
        et.createCell("555555");
        et.createCell("eeeeee");
        et.createCell("a1");
        et.createCell("a2a2");
        et.createNewRow();
        et.createCell("555555");
        et.createCell("eeeeee");
        et.createCell("a1");
        et.createCell("a2a2");
        et.createNewRow();
        et.createCell("555555");
        et.createCell("eeeeee");
        et.createCell("a1");
        et.createCell("a2a2");
        et.createNewRow();
        et.createCell("555555");
        et.createCell("eeeeee");
        et.createCell("a1");
        et.createCell("a2a2");


        Map<String,String> datas = new HashMap<String,String>();
        datas.put("title","测试用户信息");
        datas.put("user","大威天龙");
        SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");//设置日期格式
        datas.put("time",df.format(new Date()));
        datas.put("teacher","隔壁老王");
        et.replaceFinalData(datas);
        et.insertSer();
        et.writeToFile("C:\\Users\\CurvedMirror\\Desktop\\javapoiexcel\\src\\main\\resources\\excel\\test01.xls");
    }
}
